import axios from "axios"

function axiosGet(url, params) {
    let baseUrl = '/api' + url
    return new Promise(function (resolve, reject) {
        axios.get(baseUrl, params).then(function (res) {
            resolve(res)
        }).catch(function (err) {
            reject(err)
        })
    })
}

function axiosPost(url,params){
    let baseUrl = "/api" + url
    return new Promise(function(resolve,reject){
        axios.post(baseUrl,params).then(function(res){
            resolve(res)
        }).catch(function(err){
            reject(err)
        })
    })
}

export {
    axiosGet,axiosPost
}